url = "/blog/post/:slug"
layout = "blog"
title = "Blop Page"
description = "Single Post"

[viewBag]
localeUrl[de] = "/magazin/beitrag/:slug"
localeTitle[de] = "Einzelner Beitrag"

[blogPost]
slug = "{{ :slug }}"
categoryPage = "blog/category"

==
<?php
function onEnd()
{
    if (!empty($this->post)) {
        $this->page->title = $this->post->title;
        $this->page->meta_title = $this->post->title;
        $this->page->meta_description = !empty($this->post->excerpt)? $this->post->excerpt: strip_tags($this->post->summary);

        $this->post->viewCountAdd();
        if ($this->post->user) {
            
        }

    } else {
        $this->setStatusCode(404);
        return $this->controller->run('404');
    }
}
?>
==


<div class="post-single post-layout-{{ layout }}">
    <section class="section section-posts">
        <header class="py-1 py-lg-6 bg-light dark:bg-dark">
            <div class="container">
                <div class="post-header{% if post.featured_images %} post-has-thumbnail{% endif %}">
                    <h1 class="post-title">{{ post.title }}</h1>

                    <time class="post-published" datetime="{{ post.published_at }}">
                        {{ post.published_at | date(this.theme.datetime_format) }}
                    </time>
                </div>

                {% if post.featured_images %}
                    <div class="post-thumbnail">
                        <img src="{{ post.featured_images.0.getPath() }}" alt="{{ post.title }}" />
                    </div>
                {% endif %}
            </div>
        </header>

        <article class="py-2 py-lg-6 section section-with-sidebar">

            <div class="container">
                <div class="main-area post-content py-4 py-lg-0">
                    {{ post.content_html | raw }}

                    {% if post.ratmd_bloghub_meta_data.images and post.featured_images|length > 1 %}
                        {% if post.ratmd_bloghub_meta_data.images == 'carousel' %}
                            {% partial "blog/components/carousel" images=post.featured_images|slice(1) %}
                        {% elseif post.ratmd_bloghub_meta_data.images == 'gallery' %}
                            {% partial "blog/components/gallery" images=post.featured_images|slice(1) %}
                        {% endif %}
                    {% endif %}

                    {% component 'bloghubCommentSection' %}
                </div>
                <aside class="sidebar-area post-aside{% if post.featured_images %} post-has-thumbnail{% endif %}">
                    {% for widget in this.theme.sidebar_post %}
                        
                    {% else %}
                        No widget
                    {% endfor %}

                </aside>
            </div>
        </article>

        <footer class="pb-6">
           
        </footer>
    </section>
</div>